#include <pthread.h>
#include <iostream>
#include <unistd.h>

void* PthreadRun(void *pData)
{
    while (true)
    {
        std::cout << "Hello pttread : " << pthread_self() << std::endl;
        sleep(1);
    }
    return nullptr;
}

int main()
{
    pthread_t tid[10] = {0};
    for (int i = 0; i < 10; ++i)
    {
        pthread_create(tid + i, nullptr, PthreadRun, nullptr);
    }

    for (int i = 0; i < 10; ++i)
    {
        pthread_join(tid[i], nullptr);
    }

    return 0;
}